package com.yf.custom.annotation;

import com.yf.custom.annotation.LoginRequired;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName TestAction
 * @Description TODO
 * @Author yf
 * @Date 2018/10/15 13:56
 * @Version 1.0
 */
@RestController
public class LoginAction {
    private static final Logger LOGGER= LoggerFactory.getLogger(LoginAction.class);

    /**
     * 首页数据接口，无需登录
     * @return
     */
    @RequestMapping("index")
    public String index(){
        return "index";
    }

    /**
     * 签到接口（需要在登录状态下）
     * @param request
     * @return
     */
    @LoginRequired(required = true)
    @RequestMapping("signIn")
    public String signIn(HttpServletRequest request){
        //进行签到逻辑
        return "success";
    }
}
